#include "Square.h"
#include "Chessboard.h"

namespace Core
{

	Square::Square(Chessboard * board, int rank, int column)
	{
		if(board == NULL)
			throw "Square.ctor: argument cannot be NULL";
		_board = board;
		_rank = rank;
		_column = column;
		_piece = NULL;
	}


	Square::~Square(void)
	{
	}

	Piece * Square::piece() const
	{
		return _piece;
	}

	void Square::piece( Piece * val )
	{
		_piece = val;
		if(_piece != NULL)
			_piece->square(this);
	}

}
